from django.http import HttpRequest, HttpResponseBadRequest


class TestMiddleware:
    def __init__(self, get_response):
        self.get_response = get_response

    def __call__(self, request):
        assert isinstance(request, HttpRequest)

        if request.method != "POST":
            return HttpResponseBadRequest()

        response = self.get_response(request)
        # TODO: add code to process response.
        return response

    def process_view(self, view_func, *args, **kwargs):
        pass
